<?php
namespace App\Http\Controllers\Client\Activity;

use App\Http\Controllers\ClientController;
use Illuminate\Support\Facades\DB;

class ActivityParticipateRecordController extends ClientController
{

    public function index()
    {
        $all = $this->all;

        $act_id = $all['act_id'];

        $result = DB::table('lottery_users_draw as lud')
            ->leftJoin('lottery_users as lu','lud.we_id','=','lu.we_id')
            ->leftJoin('talent','lud.we_id','=','talent.we_id')
            ->where('lud.act_id', '=', $act_id)
            ->latest('lud.participate_id')
            ->select('lud.created_at','lu.nickname','lu.headimgurl','talent.account_name')
            ->get()
            ->toArray();

        return $this->setReturnJson(0,'success',$result);

    }

}
